package com.itheima.d4_byte_stream;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

public class FileInputStreamTest3 {
    public static void main(String[] args) throws Exception {
        InputStream is =new FileInputStream("Day17\\src\\itheima02.txt");

        /*File f =new File("Day17\\src\\itheima02.txt");
        long size = f.length();
        byte[] buffer = new byte[(int) size];

        int len = is.read(buffer);
        System.out.println(new String(buffer));
        System.out.println("读取的字节："+size);
        System.out.println("读取的长度："+len);
        is.close();*/

        byte[] buffer = is.readAllBytes();
        System.out.println(new String(buffer));
        is.close();


    }
}
